CISC 1110 Lab 3



1. Write a program which will let you store a value with decimal places in a variable named realnumber and then process it.


First, declare a variable named realnumber.


Then use an assignment statement to give a value to realnumber. Give it the value

3 – 5.0 / 3

 

Print realnumber to cout.


Then write two if statements to determine what to print:


     • If realnumber is greater than or equal to 1, print the message "is greater than 1".


     • If realnumber is negative, print "is less than zero".


Print a final line saying "done".



2. Now change the program so that you give realnumber the value (3 – 5.0) / 3

    Run the program again and view the output.